package com.xiaozhameng.javaapi;

import java.util.ArrayList;
import java.util.Random;

public class ArrayListDemo {

    public static void main(String[] args) {
        int[] data = new int[100];
        ArrayList<Integer> dataList = new ArrayList<>();

        Random random = new Random(1000);
        for (int i = 0; i < 100; i++) {
            int item = random.nextInt(500);
            data[i] = item;
            dataList.add(item);
        }

        // 开始读
        for (int i = 0; i < 100; i++) {
            System.out.println(data[i]);
            System.out.println(dataList.get(i));
        }

    }
}
